package projects;

public class Caculatefee {
    //根据通话时长，计算话
    private double cost;
    //返回话费
    private int minminiute = 20;
    private double minprice = 0.05;
    private double maxprice = 1;
    private double exprice = 0.1;

    public double calculate(final int totalminiute) {
        if (totalminiute <= minminiute) {
            cost = minprice * totalminiute;
        } else {
            cost = maxprice + (totalminiute - minminiute) * exprice;
        }
        double costfree = cost;
        return costfree;
    }
}
